Add @final to slice/memoryview/range#6289
Conversation
None of these classes can be subclassed at runtime.
|
Looks like you found a mypy bug: ast.pyi defines its own class called slice, but somehow it's checking |
This comment has been minimized.
This comment has been minimized.
😣 |
|
Hmm, the other weird thing is that the mypy tests pass, it's only when running the mypy build in the stubtest invocation does it fail... |
|
hmm hmm hmm, locally: |
|
Spent some more time digging through mypy code, it's pretty thorny. Here's a one character fix: There's really a lot going on here: 1) collision with a name in builtins, 2) builtins depending on ast, 3) ast doing |
Amazing, thanks for looking into it! I'll see if I can edit my patch tomorrow. |
|
Thanks for investigating @hauntsaninja! Not sure if it will make a difference, but it looks like we can also remove |
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
Huzzah! |
None of these classes can be subclassed at runtime.